#ifndef SHADER_INIT_H
#define SHADER_INIT_H

#include <GL/glew.h>
#include "fs_containers.h"
#include <string>

using namespace std;

// Forward
void initForwardAmbient(fs_first_pass_shaders &ambient);
void initForwardPoint(fs_first_pass_shaders &point);
void initForwardDirectional(fs_first_pass_shaders &directional);
void initForwardSpot(fs_first_pass_shaders &spot);

// Deferred
void initDeferredGBuffer(fs_first_pass_shaders &gBuffer);
void initDeferredViewGBuffer(fs_shader_container &viewGBuffer);
void initDeferredAmbient(fs_shader_container &ambient);
void initDeferredDirectional(fs_shader_container &directional);
void initDeferredPoint(fs_shader_container &point);
void initDeferredSpot(fs_shader_container &spot);

// HDR Texture
void initHDRTexture(fs_shader_container &hdrTextureShader);

// CUDA Texture
void initCUDATexture(fs_shader_container &cudaTextureShader);

// White Shader
void initWhiteShader(fs_shader_container &whiteShader);

// Post-process Detection
void initPostProcessSetup(fs_shader_container &postProcessSetupShader);
void initPostProcess(fs_shader_container &postProcessShader);

// Set Uniforms
void setFirstPassViewAndProjection(fs_first_pass_shaders &shader, mat4 &view, mat4 &perspective);

void setUpAndDownVector(fs_first_pass_draw_options settings);
void setUpAndDownVector(fs_shader_container shader, mat4 view);

void setTopAndBottomColor(fs_first_pass_draw_options settings);
void setTopAndBottomColor(fs_shader_container shader);

string ppDefines(int shaderID);
void initPostProcessShaders(fs_shader_container *shaders);

// SHADER FILE PATHS - FORWARD
#define FORWARD_AMBIENT_VERT "..\\shaders\\forward\\forward_ambient.vert"
#define FORWARD_AMBIENT_FRAG "..\\shaders\\forward\\forward_ambient.frag"
#define FORWARD_POINT_VERT "..\\shaders\\forward\\forward_point.vert"
#define FORWARD_POINT_FRAG "..\\shaders\\forward\\forward_point.frag"
#define FORWARD_DIRECTIONAL_VERT "..\\shaders\\forward\\forward_directional.vert"
#define FORWARD_DIRECTIONAL_FRAG "..\\shaders\\forward\\forward_directional.frag"
#define FORWARD_SPOT_VERT "..\\shaders\\forward\\forward_spot.vert"
#define FORWARD_SPOT_FRAG "..\\shaders\\forward\\forward_spot.frag"

// SHADER FILE PATHS - DEFERRED
#define GBUFFER_VERT "..\\shaders\\deferred\\gbuffer.vert"
#define GBUFFER_FRAG "..\\shaders\\deferred\\gbuffer.frag"
#define GBUFFER_DISPLAY_VERT "..\\shaders\\deferred\\gbufferDisplay.vert"
#define GBUFFER_DISPLAY_FRAG "..\\shaders\\deferred\\gbufferDisplay.frag"
#define DEF_AMBIENT_VERT "..\\shaders\\deferred\\gbufferAmbient.vert"
#define DEF_AMBIENT_FRAG "..\\shaders\\deferred\\gbufferAmbient.frag"
#define DEF_POINT_VERT "..\\shaders\\deferred\\gbufferPoint.vert"
#define DEF_POINT_FRAG "..\\shaders\\deferred\\gbufferPoint.frag"
#define DEF_DIRECTIONAL_VERT "..\\shaders\\deferred\\gbufferDirectional.vert"
#define DEF_DIRECTIONAL_FRAG "..\\shaders\\deferred\\gbufferDirectional.frag"
#define DEF_SPOT_VERT "..\\shaders\\deferred\\gbufferSpot.vert"
#define DEF_SPOT_FRAG "..\\shaders\\deferred\\gbufferSpot.frag"

// SHADER FILE PATHS - DEFERRED 4.1
#define GBUFFER_VERT_41 "..\\shaders\\deferred41\\gbuffer.vert"
#define GBUFFER_FRAG_41 "..\\shaders\\deferred41\\gbuffer.frag"
#define GBUFFER_DISPLAY_VERT_41 "..\\shaders\\deferred41\\gbufferDisplay.vert"
#define GBUFFER_DISPLAY_FRAG_41 "..\\shaders\\deferred41\\gbufferDisplay.frag"
#define DEF_AMBIENT_VERT_41 "..\\shaders\\deferred41\\gbufferAmbient.vert"
#define DEF_AMBIENT_FRAG_41 "..\\shaders\\deferred41\\gbufferAmbient.frag"
#define DEF_POINT_VERT_41 "..\\shaders\\deferred41\\gbufferPoint.vert"
#define DEF_POINT_FRAG_41 "..\\shaders\\deferred41\\gbufferPoint.frag"
#define DEF_DIRECTIONAL_VERT_41 "..\\shaders\\deferred41\\gbufferDirectional.vert"
#define DEF_DIRECTIONAL_FRAG_41 "..\\shaders\\deferred41\\gbufferDirectional.frag"
#define DEF_SPOT_VERT_41 "..\\shaders\\deferred41\\gbufferSpot.vert"
#define DEF_SPOT_FRAG_41 "..\\shaders\\deferred41\\gbufferSpot.frag"

// SHADER FILE PATHS - HDR
#define HDR_TEXTURE_VERT "..\\shaders\\hdr.vert"
#define HDR_TEXTURE_FRAG "..\\shaders\\hdr.frag"

// SHADER FILE PATHS - CUDA
#define CUDA_TEXTURE_VERT "..\\shaders\\cudaDisp.vert"
#define CUDA_TEXTURE_FRAG "..\\shaders\\cudaDisp.frag"

// SHADER FILE PATHS - EDGE DETECTION
#define PP_SETUP_VERT "..\\shaders\\post processing\\postProcessSetup.vert"
#define PP_SETUP_FRAG "..\\shaders\\post processing\\postProcessSetup.frag"
#define PP_VERT "..\\shaders\\post processing\\postProcess.vert"
#define PP_FRAG "..\\shaders\\post processing\\postProcess.frag"

// WHITE SHADER
#define WHITE_VERT "..\\shaders\\post processing\\white.vert"
#define WHITE_FRAG "..\\shaders\\post processing\\white.frag"

namespace quad_attributes {
	enum {
		POSITION,
		TEXCOORD
	};
}

#endif // #ifndef SHADER_INIT_H